import { createHashRouter, Navigate } from "react-router-dom";
import Error403 from "@lgq/pages/Error403";
import Error404 from "@lgq/pages/Error404";
import Error500 from "@lgq/pages/Error500";
import Login from "@lgq/pages/login/Login";

const routers = [
  {
    path: "/",
    element: <Navigate to="/login" />,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "*",
    element: <Navigate to="/404" />,
  },
  {
    path: "/403",
    element: <Error403 />,
  },
  {
    path: "/404",
    element: <Error404 />,
  },
  {
    path: "/500",
    element: <Error500 />,
  },
];

//组件路由
// export default function Router() {
//   return useRoutes(routers);
// }

const router = createHashRouter(routers);

//API 路由
export default router;
